package service;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;


//专门负责调用计时的处理器类
public  class TimerInvocationHandler implements InvocationHandler {
    Object target;
    public TimerInvocationHandler(Object target) {
        this.target = target;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {

        System.out.println("增强1");
        //调用目标对象的目标方法

        Object reValue = method.invoke(target, args);

        System.out.println("增强2");
        return null;
    }
}
